﻿using System;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Activation;



namespace WebScraper
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    public class WebScraper : IWebScraper
    {
        public string CaptureURL(string url, string data)
        {
            Domain.ScraperRequest sr = new Domain.ScraperRequest(url, data);
            return sr.Response;
        }

        public byte[] CaptureURLInBinary(string url, string data, int size)
        {
            Domain.ScraperRequest sr = new Domain.ScraperRequest(url, data, size);
            return sr.ResponseBinary;
        }
    }
}
